|
|
|
|
|
|
|
The DataGrid is a fairly complicated control and has many properties that control its behavior. As with many other controls, Property Pages provide an organized way to access these properties. To access a control's Property Pages, right-click the control, and choose Properties from the context menu. The Property Pages dialog box for the DataGrid is shown in Figure 28.10. |
|
|
|
|
|
|
|
|
Figure 28.10
Most aspects of the DataGrid control
are set up vial the Property Pages. |
|
|
|
|
|
|
|
|
In the following sections, you explore how you use each of the Property Pages to control the grid and examine the issues involved with interacting with a data source. |
|
|
|
|
|
|
|
|
The General Property Pages tab, shown in Figure 28.10, contains some options that control overall grid behavior. Other tabs, such as Columns and Layout, allow you to adjust properties of individual grid elements. |
|
|
|
|
|
|
|
|
|
Look ahead to the section "Customizing the Grid's Layout" for information on the Columns and Layout tabs. "Customizing the Grid with Code" and ''Splitting Up the Grid" cover other approaches to customizing the DataGrid control.  |
|
|
|
|
|
|
|
|
|
|
Some of the properties that affect the grid's appearance are listed here: |
|
|
|
|
|
|
|
|
The Caption property controls the title that appears at the top of the grid. Set it to an empty string if you do not want the title heading to appear at all. |
|
|
|
|
|
|
|
|
The ColumnHeaders property turns on or off the header row at the top of the grid. By default, the heading of a given column is the name of the database field displayed in that column, but as you will see, you can change the headings to suit your needs. The height of the column header row is controlled by the HeadLines property. Simply set HeadLines to an integer representing the desired height in number of rows. |
|
|
|
|
|
|
|
|
You can control the overall look of the DataGrid with the Appearance property. It has two settings, dbgFlat and dbg3d (the default), which cause the grid to be drawn with a flat or three-dimensional look, respectively. |
|
|
|
|
|